home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / progtool / c / gcc / gcc258s.zoo / gcc-255.diff < prev    next >
Encoding:
Text File  |  1994-01-30  |  68.2 KB  |  2,469 lines

  1. *** gcc-2.5.0/c-lex.c    Wed Sep 29 01:42:10 1993
  2. --- /net/acae127/home/bammi/usr2/gcc/c-lex.c    Mon Nov 15 14:53:25 1993
  3. ***************
  4. *** 473,484 ****
  5. --- 473,486 ----
  6.       case '\r':
  7.         /* ANSI C says the effects of a carriage return in a source file
  8.            are undefined.  */
  9. + #ifndef atarist /* but not on an atarist, though hopefully we should'nt see it */
  10.         if (pedantic && !newline_warning)
  11.           {
  12.             warning ("carriage return in source file");
  13.             warning ("(we only warn about the first carriage return)");
  14.             newline_warning = 1;
  15.           }
  16. + #endif
  17.         c = getc (finput);
  18.         break;
  19.   
  20. ***************
  21. *** 1432,1438 ****
  22.       if (floatflag != NOT_FLOAT)
  23.         {
  24.           tree type = double_type_node;
  25. !         int garbage_chars = 0, exceeds_double = 0;
  26.           int imag = 0;
  27.           REAL_VALUE_TYPE value;
  28.           jmp_buf handler;
  29. --- 1434,1440 ----
  30.       if (floatflag != NOT_FLOAT)
  31.         {
  32.           tree type = double_type_node;
  33. !         int garbage_chars = 0;
  34.           int imag = 0;
  35.           REAL_VALUE_TYPE value;
  36.           jmp_buf handler;
  37. ***************
  38. *** 1531,1572 ****
  39.   
  40.               type = float_type_node;
  41.               value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
  42. -             if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  43. -             && REAL_VALUE_ISINF (value) && pedantic)
  44. -               pedwarn ("floating point number exceeds range of `float'");
  45.             }
  46.           else if (lflag)
  47.             {
  48.               type = long_double_type_node;
  49.               value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
  50. -             if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  51. -             && REAL_VALUE_ISINF (value) && pedantic)
  52. -               pedwarn ("floating point number exceeds range of `long double'");
  53.             }
  54.           else
  55.             {
  56.               value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
  57. -             if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  58. -             && REAL_VALUE_ISINF (value) && pedantic)
  59. -               pedwarn ("floating point number exceeds range of `double'");
  60.             }
  61.   
  62.           set_float_handler (NULL_PTR);
  63.           }
  64.   #ifdef ERANGE
  65. !         if (errno == ERANGE && !flag_traditional && pedantic)
  66.             {
  67. !           /* ERANGE is also reported for underflow,
  68. !              so test the value to distinguish overflow from that.  */
  69. !         if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  70. !             && (REAL_VALUES_LESS (dconst1, value)
  71. !             || REAL_VALUES_LESS (value, dconstm1)))
  72. !           {
  73. !             pedwarn ("floating point number exceeds range of `double'");
  74. !             exceeds_double = 1;
  75. !           }
  76.             }
  77. - #endif
  78.           garbage_chars = 0;
  79.           while (isalnum (c) || c == '.' || c == '_'
  80.              || (!flag_traditional && (c == '+' || c == '-')
  81. --- 1533,1566 ----
  82.   
  83.               type = float_type_node;
  84.               value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
  85.             }
  86.           else if (lflag)
  87.             {
  88.               type = long_double_type_node;
  89.               value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
  90.             }
  91.           else
  92.             {
  93.               value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
  94.             }
  95.   
  96.           set_float_handler (NULL_PTR);
  97.           }
  98. +         if (pedantic
  99. +         && (REAL_VALUE_ISINF (value)
  100.   #ifdef ERANGE
  101. !             || (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  102. !             && errno == ERANGE
  103. !             /* ERANGE is also reported for underflow, so test the
  104. !                value to distinguish overflow from that.  */
  105. !             && (REAL_VALUES_LESS (dconst1, value)
  106. !                 || REAL_VALUES_LESS (value, dconstm1)))
  107. ! #endif
  108. !             ))
  109.             {
  110. !         pedwarn ("floating point number exceeds range of `%s'",
  111. !              IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))));
  112.             }
  113.           garbage_chars = 0;
  114.           while (isalnum (c) || c == '.' || c == '_'
  115.              || (!flag_traditional && (c == '+' || c == '-')
  116. *** gcc-2.5.0/calls.c    Mon Nov 15 11:07:51 1993
  117. --- /net/acae127/home/bammi/usr2/gcc/calls.c    Mon Nov 15 14:48:42 1993
  118. ***************
  119. *** 2107,2112 ****
  120. --- 2107,2118 ----
  121.   
  122.     argvec = (struct arg *) alloca (nargs * sizeof (struct arg));
  123.   
  124. + /* how would you do this RIGHT ?? fake a DECL node? dunno... */
  125. + #ifdef ENCODE_SECTION_INFO
  126. +   /* mark it as a function (to be in the text section that is) */
  127. +   SYMBOL_REF_FLAG (fun) = 1;
  128. + #endif
  129.     INIT_CUMULATIVE_ARGS (args_so_far, NULL_TREE, fun);
  130.   
  131.     args_size.constant = 0;
  132. ***************
  133. *** 2403,2408 ****
  134. --- 2409,2419 ----
  135.        library functions shouldn't have many args.  */
  136.   
  137.     argvec = (struct arg *) alloca ((nargs + 1) * sizeof (struct arg));
  138. + #ifdef ENCODE_SECTION_INFO
  139. +   /* mark it as a function (to be in the text section that is) */
  140. +   SYMBOL_REF_FLAG (fun) = 1;
  141. + #endif
  142.   
  143.     INIT_CUMULATIVE_ARGS (args_so_far, NULL_TREE, fun);
  144.   
  145. diff -rc gcc-2.5.0/cccp.c /net/acae127/home/bammi/usr2/gcc/cccp.c
  146. *** gcc-2.5.0/cccp.c    Mon Nov 15 11:07:51 1993
  147. --- /net/acae127/home/bammi/usr2/gcc/cccp.c    Mon Nov 15 14:58:06 1993
  148. ***************
  149. *** 77,82 ****
  150. --- 77,83 ----
  151.   #include <stdio.h>
  152.   #include <signal.h>
  153.   
  154. + #ifndef atarist
  155.   #ifndef VMS
  156.   #ifndef USG
  157.   #include <sys/time.h>        /* for __DATE__ and __TIME__ */
  158. ***************
  159. *** 86,95 ****
  160. --- 87,110 ----
  161.   #include <fcntl.h>
  162.   #endif /* USG */
  163.   #endif /* not VMS */
  164. + #endif /* not atarist */
  165.   
  166.   /* This defines "errno" properly for VMS, and gives us EACCES. */
  167.   #include <errno.h>
  168.   
  169. + /* atarist  specific defs and includes */
  170. + #ifdef atarist
  171. + #include <time.h>
  172. + #include <file.h>
  173. + #include <string.h>
  174. + #include <stddef.h>
  175. + long _stksize = -1L;    /* want big stack cause include files
  176. +                    get alloca'ed there */
  177. + #define read(fd,buf,size)    _text_read(fd,buf,size)
  178. + #endif /* atarist */
  179.   /* VMS-specific definitions */
  180.   #ifdef VMS
  181.   #include <time.h>
  182. ***************
  183. *** 1073,1078 ****
  184. --- 1088,1099 ----
  185.     /* Target-name to write with the dependency information.  */
  186.     char *deps_target = 0;
  187.   
  188. + #ifdef atarist
  189. + #define GCC_INCLUDE_DIR "./"
  190. + /* turn this on if you are going to set the TOS 1.4 dont clear heap flag */
  191. + /*  _malloczero(1); */     /* zero mallocs by default */
  192. + #endif  
  193.   #ifdef RLIMIT_STACK
  194.     /* Get rid of any avoidable limit on stack size.  */
  195.     {
  196. ***************
  197. *** 1395,1404 ****
  198. --- 1416,1431 ----
  199.       break;
  200.   
  201.         case 'v':
  202. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  203. + #include "PatchLev.h"
  204. +     fprintf (stderr, "GNU CPP-atariST version %s Patchlevel %s",
  205. +          version_string, PatchLevel);
  206. + #else
  207.       fprintf (stderr, "GNU CPP version %s", version_string);
  208.   #ifdef TARGET_VERSION
  209.       TARGET_VERSION;
  210.   #endif
  211. + #endif
  212.       fprintf (stderr, "\n");
  213.       verbose = 1;
  214.       break;
  215. ***************
  216. *** 1532,1537 ****
  217. --- 1559,1565 ----
  218.       }
  219.     }
  220.   
  221. + #if (!(defined(atarist) || defined(CROSSATARI) || defined(atariminix)))
  222.     /* Add dirs from CPATH after dirs from -I.  */
  223.     /* There seems to be confusion about what CPATH should do,
  224.        so for the moment it is not documented.  */
  225. ***************
  226. *** 1541,1546 ****
  227. --- 1569,1575 ----
  228.     p = (char *) getenv ("CPATH");
  229.     if (p != 0 && ! no_standard_includes)
  230.       path_include (p);
  231. + #endif
  232.   
  233.     /* Now that dollars_in_ident is known, initialize is_idchar.  */
  234.     initialize_char_syntax ();
  235. ***************
  236. *** 1659,1666 ****
  237.     { /* read the appropriate environment variable and if it exists
  238.          replace include_defaults with the listed path. */
  239.       char *epath = 0;
  240.       switch ((objc << 1) + cplusplus)
  241. !       {
  242.         case 0:
  243.       epath = getenv ("C_INCLUDE_PATH");
  244.       break;
  245. --- 1688,1743 ----
  246.     { /* read the appropriate environment variable and if it exists
  247.          replace include_defaults with the listed path. */
  248.       char *epath = 0;
  249. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  250. +     int db_hack = 0;
  251. +     char *e1 = getenv("GNUINC"), *e2 = getenv("GNULIB"),
  252. +          *e3 = getenv("GXXINC");
  253. +     /* Get length of the alloc'ed array. (Yeah I know, I might alloc
  254. +      * a character more than I need but who cares...
  255. +      */
  256. +     if (cplusplus && e3)
  257. +     db_hack += strlen (e3);
  258. +     if (e1)
  259. +         db_hack += strlen (e1) + 1;
  260. +     if (e2)
  261. +         db_hack += strlen (e1) + 1;
  262. +     if (db_hack) {
  263. +     epath = alloca (db_hack + 1);
  264. +     *epath = '\0';
  265. +     db_hack = 0;
  266. +     /* Concatenate the paths together. */
  267. +     if (cplusplus && e3) {
  268. +         strcpy (epath, e3);
  269. +         db_hack = 1;
  270. +     }
  271. +     if (e1) {
  272. +         if (db_hack) {
  273. +         strcat (epath, PATH_SEP_STR);
  274. +         }
  275. +         strcat (epath, e1);
  276. +         db_hack = 1;
  277. +     }
  278. +     if (e2) {
  279. +         if (db_hack) {
  280. +         strcat (epath, PATH_SEP_STR);
  281. +         }
  282. +         strcat (epath, e2);
  283. +     }
  284. +     }
  285. + #ifdef atarist
  286. +     if (epath)
  287. +         for (e3=epath; *e3; e3++)    /* Use one kind of path separator */
  288. +         if (*e3 == ';')
  289. +         *e3 = PATH_SEPARATOR;
  290. + #endif
  291. + #else
  292.       switch ((objc << 1) + cplusplus)
  293. !     {
  294.         case 0:
  295.       epath = getenv ("C_INCLUDE_PATH");
  296.       break;
  297. ***************
  298. *** 1673,1679 ****
  299.         case 3:
  300.       epath = getenv ("OBJCPLUS_INCLUDE_PATH");
  301.       break;
  302. !       }
  303.       /* If the environment var for this language is set,
  304.          add to the default list of include directories.  */
  305.       if (epath) {
  306. --- 1750,1758 ----
  307.         case 3:
  308.       epath = getenv ("OBJCPLUS_INCLUDE_PATH");
  309.       break;
  310. !     }
  311. ! #endif
  312.       /* If the environment var for this language is set,
  313.          add to the default list of include directories.  */
  314.       if (epath) {
  315. ***************
  316. *** 1727,1739 ****
  317. --- 1806,1828 ----
  318.     if (!no_standard_includes) {
  319.       struct default_include *p = include_defaults;
  320.       char *specd_prefix = include_prefix;
  321. + #ifdef GCC_INCLUDE_DIR
  322.       char *default_prefix = savestring (GCC_INCLUDE_DIR);
  323. + #else
  324. +     char *default_prefix = savestring ("./");
  325. + #endif
  326.       int default_len = 0;
  327.       /* Remove the `include' from /usr/local/lib/gcc.../include.  */
  328.       if (!strcmp (default_prefix + strlen (default_prefix) - 8, "/include")) {
  329.         default_len = strlen (default_prefix) - 7;
  330.         default_prefix[default_len] = 0;
  331.       }
  332. + #ifdef atarist
  333. +     else if (!strcmp (default_prefix + strlen (default_prefix) - 8, "\\include")) {
  334. +       default_len = strlen (default_prefix) - 7;
  335. +       default_prefix[default_len] = 0;
  336. +     }
  337. + #endif
  338.       /* Search "translated" versions of GNU directories.
  339.          These have /usr/local/lib/gcc... replaced by specd_prefix.  */
  340.       if (specd_prefix != 0 && default_len != 0)
  341. ***************
  342. *** 1875,1881 ****
  343. --- 1964,1974 ----
  344.         char *p1 = p;
  345.         /* Discard all directory prefixes from P.  */
  346.         while (*p1) {
  347. + #ifdef atarist
  348. +     if ((*p1 == '/') || (*p1 == '\\'))
  349. + #else
  350.       if (*p1 == '/')
  351. + #endif
  352.         p = p1 + 1;
  353.       p1++;
  354.         }
  355. ***************
  356. *** 2049,2054 ****
  357. --- 2142,2148 ----
  358.     return 0;
  359.   }
  360.   
  361. + #if (!(defined(atarist) || defined(CROSSATARI) || defined(atariminix)))
  362.   /* Given a colon-separated list of file names PATH,
  363.      add all the names to the search path for include files.  */
  364.   
  365. ***************
  366. *** 2096,2101 ****
  367. --- 2190,2196 ----
  368.         p++;
  369.       }
  370.   }
  371. + #endif /* atarist */
  372.   
  373.   /* Pre-C-Preprocessor to translate ANSI trigraph idiocy in BUF
  374.      before main CCCP processing.  Name `pcp' is also in honor of the
  375. ***************
  376. *** 3282,3287 ****
  377. --- 3377,3383 ----
  378.     assertions_flag = save_assertions_flag;
  379.     return obuf;
  380.   }
  381. + /* #endif */
  382.   
  383.   /*
  384.    * Process a # directive.  Expects IP->bufp to point after the '#', as in
  385. ***************
  386. *** 3981,3987 ****
  387. --- 4077,4088 ----
  388.           dsp[0].next = search_start;
  389.           search_start = dsp;
  390.   #ifndef VMS
  391. + #ifdef atarist
  392. +         if((ep = rindex(nam, '\\')) == NULL)
  393. +         ep = rindex(nam, '/');
  394. + #else
  395.           ep = rindex (nam, '/');
  396. + #endif
  397.   #else                /* VMS */
  398.           ep = rindex (nam, ']');
  399.           if (ep == NULL) ep = rindex (nam, '>');
  400. ***************
  401. *** 4061,4069 ****
  402. --- 4162,4184 ----
  403.   
  404.     /* If specified file name is absolute, just open it.  */
  405.   
  406. + #ifdef atarist
  407. +   if ((*fbeg == '\\') || (*fbeg == '/')) {
  408. +     if(fbeg[2] == ':')
  409. +     { /* allow "\D:\xxx" */
  410. +         strncpy (fname, fbeg+1, flen-1);
  411. +         fname[flen-1] = 0;
  412. +     }
  413. +     else
  414. +     {  /* allow "\lib\xxx" == "\currentdrive:\lib\xxx" */
  415. +         strncpy (fname, fbeg, flen);
  416. +         fname[flen] = 0;
  417. +     }
  418. + #else
  419.     if (*fbeg == '/') {
  420.       strncpy (fname, fbeg, flen);
  421.       fname[flen] = 0;
  422. + #endif
  423.       if (redundant_include_p (fname))
  424.         return 0;
  425.       if (importing)
  426. ***************
  427. *** 4084,4090 ****
  428. --- 4199,4209 ----
  429.       if (searchptr->fname[0] == 0)
  430.         continue;
  431.       strcpy (fname, searchptr->fname);
  432. + #ifdef atarist
  433. +     strcat (fname, "\\");
  434. + #else
  435.       strcat (fname, "/");
  436. + #endif
  437.       fname[strlen (fname) + flen] = 0;
  438.         } else {
  439.       fname[0] = 0;
  440. ***************
  441. *** 4197,4213 ****
  442.   
  443.       if (!no_precomp)
  444.         do {
  445.       sprintf (pcftry, "%s%d", fname, pcfnum++);
  446.       
  447.       pcf = open (pcftry, O_RDONLY, 0666);
  448.       if (pcf != -1)
  449.         {
  450.           struct stat s;
  451.   
  452.           fstat (pcf, &s);
  453.           if (bcmp (&stat_f.st_ino, &s.st_ino, sizeof (s.st_ino))
  454.           || stat_f.st_dev != s.st_dev)
  455. !           {
  456.           pcfbuf = check_precompiled (pcf, fname, &pcfbuflimit);
  457.           /* Don't need it any more.  */
  458.           close (pcf);
  459. --- 4316,4374 ----
  460.   
  461.       if (!no_precomp)
  462.         do {
  463. + #ifdef atarist
  464. +     int numlen;
  465. +     char *dot;
  466. +     char *slash;
  467. +     /* cut extension to 3 chars and dont depend on UNIXMODE           */
  468. +     /* this will have to be done when saving precompiled headers, too */
  469. +     /* but as far as I tried, they dont work up to now, anyway   (AL) */
  470. +       if( pcfnum>=100 )     numlen=3;
  471. +       else if( pcfnum>=10 ) numlen=2;
  472. +       else                  numlen=1;
  473. +       dot=strrchr( fname, '.' );
  474. +       if( (slash=strrchr( fname, '/')) && slash>dot )
  475. +         dot=NULL;
  476. +       else
  477. +       if( (slash=strrchr( fname, '\\')) && slash>dot )
  478. +         dot=NULL;
  479. +       if( dot ) {
  480. +         if( strlen(dot)-1>3-numlen ) {
  481. +           sprintf(pcftry, "%.*s%d", strlen(fname)-(strlen(dot)-(4-numlen)),
  482. +                   fname, pcfnum++);
  483. +         } else {
  484. +           sprintf(pcftry, "%s%d", fname, pcfnum++);
  485. +         }
  486. +       } else {
  487. +         sprintf( pcftry, "%s.%d", fname, pcfnum++);
  488. +       }
  489. + #else    /* looks like we got a sane filesystem */
  490.       sprintf (pcftry, "%s%d", fname, pcfnum++);
  491. + #endif
  492. + #if 0
  493. +     fprintf ( stderr, "trying precompiled file %s.\n", pcftry );
  494. + #endif
  495.       
  496.       pcf = open (pcftry, O_RDONLY, 0666);
  497.       if (pcf != -1)
  498.         {
  499. + #ifndef atarist
  500. +         /* dont bother with this on the ST since these field are faked
  501. +          * anyways
  502. +              */
  503.           struct stat s;
  504.   
  505.           fstat (pcf, &s);
  506.           if (bcmp (&stat_f.st_ino, &s.st_ino, sizeof (s.st_ino))
  507.           || stat_f.st_dev != s.st_dev)
  508. ! #else
  509. !         if (1)
  510. ! #endif
  511. !               {
  512.           pcfbuf = check_precompiled (pcf, fname, &pcfbuflimit);
  513.           /* Don't need it any more.  */
  514.           close (pcf);
  515. ***************
  516. *** 6210,6216 ****
  517.     free (trybuf.buf);
  518.   
  519.     /* Output directive name.  */
  520. !   check_expand (op, 8);
  521.     bcopy ("#ident ", op->bufp, 7);
  522.     op->bufp += 7;
  523.   
  524. --- 6371,6377 ----
  525.     free (trybuf.buf);
  526.   
  527.     /* Output directive name.  */
  528. !   check_expand (op, 7);
  529.     bcopy ("#ident ", op->bufp, 7);
  530.     op->bufp += 7;
  531.   
  532. ***************
  533. *** 8956,8961 ****
  534. --- 9117,9123 ----
  535.     deps_buffer[deps_size] = 0;
  536.   }
  537.   
  538. + #if (!(defined(atarist) || defined(atariminix)))
  539.   #if defined(USG) || defined(VMS)
  540.   #ifndef BSTRING
  541.   
  542. ***************
  543. *** 8992,8998 ****
  544.   }
  545.   #endif /* not BSTRING */
  546.   #endif /* USG or VMS */
  547.   
  548.   static void
  549.   fatal (str, arg)
  550. --- 9154,9160 ----
  551.   }
  552.   #endif /* not BSTRING */
  553.   #endif /* USG or VMS */
  554. ! #endif /* any atari */
  555.   
  556.   static void
  557.   fatal (str, arg)
  558. *** gcc-2.5.0/config/m68k/m68k.c    Mon Nov 15 11:07:54 1993
  559. --- /net/acae127/home/bammi/usr2/gcc/config/m68k/m68k.c    Mon Nov 15 14:48:56 1993
  560. ***************
  561. *** 61,67 ****
  562.   void
  563.   finalize_pic ()
  564.   {
  565. !   if (flag_pic && current_function_uses_pic_offset_table)
  566.       emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
  567.   }
  568.   
  569. --- 61,67 ----
  570.   void
  571.   finalize_pic ()
  572.   {
  573. !   if (flag_pic && flag_pic < 3 && current_function_uses_pic_offset_table)
  574.       emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
  575.   }
  576.   
  577. ***************
  578. *** 214,220 ****
  579.         asm_fprintf (stream, "\tmoveml %0I0x%x,%Rsp@-\n", mask);
  580.   #endif
  581.       }
  582. !   if (flag_pic && current_function_uses_pic_offset_table)
  583.       {
  584.   #ifdef MOTOROLA
  585.         asm_fprintf (stream, "\t%Olea (%Rpc, %U_GLOBAL_OFFSET_TABLE_@GOTPC), %s\n",
  586. --- 214,220 ----
  587.         asm_fprintf (stream, "\tmoveml %0I0x%x,%Rsp@-\n", mask);
  588.   #endif
  589.       }
  590. !   if (flag_pic && flag_pic < 3 && current_function_uses_pic_offset_table)
  591.       {
  592.   #ifdef MOTOROLA
  593.         asm_fprintf (stream, "\t%Olea (%Rpc, %U_GLOBAL_OFFSET_TABLE_@GOTPC), %s\n",
  594. ***************
  595. *** 801,812 ****
  596.     /* First handle a simple SYMBOL_REF or LABEL_REF */
  597.     if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
  598.       {
  599.         if (reg == 0)
  600.       abort ();
  601.   
  602. !       pic_ref = gen_rtx (MEM, Pmode,
  603. !              gen_rtx (PLUS, Pmode,
  604. !                   pic_offset_table_rtx, orig));
  605.         current_function_uses_pic_offset_table = 1;
  606.         RTX_UNCHANGING_P (pic_ref) = 1;
  607.         emit_move_insn (reg, pic_ref);
  608. --- 801,820 ----
  609.     /* First handle a simple SYMBOL_REF or LABEL_REF */
  610.     if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
  611.       {
  612. + #ifdef LEGITIMATE_BASEREL_OPERAND_P
  613. +       if (LEGITIMATE_BASEREL_OPERAND_P (orig))
  614. +     return orig;
  615. + #endif
  616.         if (reg == 0)
  617.       abort ();
  618.   
  619. !       if (flag_pic == 3)
  620. !         pic_ref = gen_rtx (PLUS, Pmode, pic_offset_table_rtx, orig);
  621. !       else
  622. !         pic_ref = gen_rtx (MEM, Pmode,
  623. !                gen_rtx (PLUS, Pmode,
  624. !                     pic_offset_table_rtx, orig));
  625.         current_function_uses_pic_offset_table = 1;
  626.         RTX_UNCHANGING_P (pic_ref) = 1;
  627.         emit_move_insn (reg, pic_ref);
  628. ***************
  629. *** 1859,1864 ****
  630. --- 1867,1875 ----
  631.         output_address (XEXP (op, 0));
  632.         if (letter == 'd' && ! TARGET_68020
  633.         && CONSTANT_ADDRESS_P (XEXP (op, 0))
  634. +       && !(TARGET_PC_REL && GET_CODE (XEXP (op, 0)) == SYMBOL_REF
  635. +            && SYMBOL_REF_FLAG (XEXP (op, 0))
  636. +            && !SYMBOL_REF_USED (XEXP (op, 0)))
  637.         && !(GET_CODE (XEXP (op, 0)) == CONST_INT
  638.              && INTVAL (XEXP (op, 0)) < 0x8000
  639.              && INTVAL (XEXP (op, 0)) >= -0x8000))
  640. ***************
  641. *** 2166,2171 ****
  642. --- 2177,2184 ----
  643.                 fprintf (file, ":w");
  644.               if ((flag_pic == 2) && (breg == pic_offset_table_rtx))
  645.                 fprintf (file, ":l");
  646. +             if ((flag_pic == 3) && (breg == pic_offset_table_rtx))
  647. +               fprintf (file, ":w");
  648.             }
  649.           if (addr != 0 && ireg != 0)
  650.             {
  651. ***************
  652. *** 2243,2248 ****
  653. --- 2256,2273 ----
  654.           fprintf (file, "%d:w", INTVAL (addr));
  655.   #endif
  656.         }
  657. +     else if (TARGET_PC_REL && GET_CODE (addr) == SYMBOL_REF
  658. +          && SYMBOL_REF_FLAG (addr) && !SYMBOL_REF_USED (addr))
  659. +       {
  660. + #ifdef MOTOROLA
  661. +         output_addr_const (file, addr);
  662. +         fputs ("(pc)", file);
  663. + #else
  664. +         fputs ("pc@(", file);
  665. +         output_addr_const (file, addr);
  666. +         putc (')', file);
  667. + #endif
  668. +       }
  669.       else
  670.         {
  671.           output_addr_const (file, addr);
  672. ***************
  673. *** 2309,2311 ****
  674. --- 2334,2352 ----
  675.   
  676.     return 0;
  677.   }
  678. + #ifdef ENCODE_SECTION_INFO
  679. + /* Does operand (which is a symbolic_operand) live in text space? If
  680. +    so SYMBOL_REF_FLAG, which is set by ENCODE_SECTION_INFO, will be true.*/
  681. + int
  682. + read_only_operand (operand)
  683. +      rtx operand;
  684. + {
  685. +   if (GET_CODE (operand) == CONST)
  686. +     operand = XEXP (XEXP (operand, 0), 0);
  687. +   if (GET_CODE (operand) == SYMBOL_REF)
  688. +     return SYMBOL_REF_FLAG (operand) || CONSTANT_POOL_ADDRESS_P (operand);
  689. +   return 1;
  690. + }
  691. + #endif
  692. *** gcc-2.5.0/config/m68k/m68k.h    Mon Nov 15 11:07:54 1993
  693. --- /net/acae127/home/bammi/usr2/gcc/config/m68k/m68k.h    Mon Nov 15 14:48:57 1993
  694. ***************
  695. *** 92,97 ****
  696. --- 92,103 ----
  697.   /* Use the 68040-only fp instructions (-m68040).  */
  698.   #define TARGET_68040_ONLY (target_flags & 01000)
  699.   
  700. + /* Use PC-relative addressing for refs to read-only data */
  701. + #define TARGET_PC_REL (target_flags & 02000)
  702. + /* Use base-relative addressing for refs to data&bss segments */
  703. + #define TARGET_BASE_REL (target_flags & 04000)
  704.   /* Macro to define tables used to set the flags.
  705.      This is a list in braces of pairs in braces,
  706.      each pair being { "NAME", VALUE }
  707. ***************
  708. *** 121,126 ****
  709. --- 127,136 ----
  710.       { "68030", -01400},                \
  711.       { "68030", 5},                \
  712.       { "68040", 01007},                \
  713. +     { "pcrel", 02000},                \
  714. +     { "nopcrel", -02000},            \
  715. +     { "baserel", 04000},            \
  716. +     { "nobaserel", -04000},            \
  717.       { "68851", 0},    /* Affects *_SPEC and/or GAS.  */    \
  718.       { "no-68851", 0},    /* Affects *_SPEC and/or GAS.  */    \
  719.       { "68302", 0},    /* Affects *_SPEC and/or GAS.  */    \
  720. ***************
  721. *** 143,154 ****
  722. --- 153,166 ----
  723.     if (! TARGET_68020 && flag_pic == 2)    \
  724.       error("-fPIC is not currently supported on the 68000 or 68010\n");    \
  725.     SUBTARGET_OVERRIDE_OPTIONS        \
  726. +   if (TARGET_BASE_REL) flag_pic = 3;    \
  727.   }
  728.   #else
  729.   #define OVERRIDE_OPTIONS        \
  730.   {                    \
  731.     if (! TARGET_68020 && flag_pic == 2)    \
  732.       error("-fPIC is not currently supported on the 68000 or 68010\n");    \
  733. +   if (TARGET_BASE_REL) flag_pic = 3;    \
  734.     SUBTARGET_OVERRIDE_OPTIONS        \
  735.   }
  736.   #endif /* defined SUPPORT_SUN_FPA */
  737. ***************
  738. *** 356,361 ****
  739. --- 368,376 ----
  740.   {                                               \
  741.     if (flag_pic)                                 \
  742.       fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;    \
  743. +   /* prevent saving/restoring of the base reg */ \
  744. +   if (flag_pic == 3)                 \
  745. +     call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
  746.   }
  747.   
  748.   #else /* defined SUPPORT_SUN_FPA */
  749. ***************
  750. *** 380,385 ****
  751. --- 395,403 ----
  752.       }                         \
  753.     if (flag_pic)                                 \
  754.       fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;    \
  755. +   /* prevent saving/restoring of the base reg */ \
  756. +   if (flag_pic == 3)                 \
  757. +     call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
  758.   }
  759.   
  760.   #endif /* defined SUPPORT_SUN_FPA */
  761. ***************
  762. *** 1155,1160 ****
  763. --- 1173,1180 ----
  764.          && GET_CODE (XEXP (X, 1)) == CONST_INT                \
  765.          && ((unsigned) INTVAL (XEXP (X, 1)) + 0x8000) < 0x10000)        \
  766.      || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx     \
  767. +        && flag_pic == 3 && CONSTANT_ADDRESS_P (XEXP (X, 1)))        \
  768. +    || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx     \
  769.          && flag_pic && GET_CODE (XEXP (X, 1)) == SYMBOL_REF)        \
  770.      || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx     \
  771.          && flag_pic && GET_CODE (XEXP (X, 1)) == LABEL_REF))        \
  772. ***************
  773. *** 1221,1227 ****
  774.   #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                \
  775.   { GO_IF_NONINDEXED_ADDRESS (X, ADDR);                    \
  776.     GO_IF_INDEXED_ADDRESS (X, ADDR);                    \
  777. !   if (flag_pic && MODE == CASE_VECTOR_MODE && GET_CODE (X) == PLUS    \
  778.         && LEGITIMATE_INDEX_P (XEXP (X, 0))                \
  779.         && GET_CODE (XEXP (X, 1)) == LABEL_REF)                \
  780.       goto ADDR; }
  781. --- 1241,1247 ----
  782.   #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                \
  783.   { GO_IF_NONINDEXED_ADDRESS (X, ADDR);                    \
  784.     GO_IF_INDEXED_ADDRESS (X, ADDR);                    \
  785. !   if ((flag_pic && flag_pic < 3) && MODE == CASE_VECTOR_MODE && GET_CODE (X) == PLUS    \
  786.         && LEGITIMATE_INDEX_P (XEXP (X, 0))                \
  787.         && GET_CODE (XEXP (X, 1)) == LABEL_REF)                \
  788.       goto ADDR; }
  789. *** gcc-2.5.0/config/m68k/m68k.md    Sun Nov 28 21:58:14 1993
  790. --- /net/acae127/home/bammi/usr2/gcc/config/m68k/m68k.md    Sun Nov 28 21:51:24 1993
  791. ***************
  792. *** 716,728 ****
  793.   {
  794.     if (flag_pic && symbolic_operand (operands[1], SImode)) 
  795.       {
  796. !       /* The source is an address which requires PIC relocation.  
  797. !          Call legitimize_pic_address with the source, mode, and a relocation
  798. !          register (a new pseudo, or the final destination if reload_in_progress
  799. !          is set).   Then fall through normally */
  800. !       extern rtx legitimize_pic_address();
  801. !       rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
  802. !       operands[1] = legitimize_pic_address (operands[1], SImode, temp);
  803.       }
  804.   }")
  805.   
  806. --- 716,733 ----
  807.   {
  808.     if (flag_pic && symbolic_operand (operands[1], SImode)) 
  809.       {
  810. ! #ifdef LEGITIMATE_BASEREL_OPERAND_P
  811. !       if (flag_pic != 3 || !LEGITIMATE_BASEREL_OPERAND_P (operands[1]))
  812. ! #endif
  813. !       {
  814. !         /* The source is an address which requires PIC relocation.  
  815. !            Call legitimize_pic_address with the source, mode, and a relocation
  816. !            register (a new pseudo, or the final destination if reload_in_progress
  817. !            is set).   Then fall through normally */
  818. !         extern rtx legitimize_pic_address();
  819. !         rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
  820. !         operands[1] = legitimize_pic_address (operands[1], SImode, temp);
  821. !       }
  822.       }
  823.   }")
  824.   
  825. ***************
  826. *** 4858,4864 ****
  827.     ""
  828.     "
  829.   {
  830. !   if (flag_pic && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
  831.   #ifdef MOTOROLA
  832.       SYMBOL_REF_FLAG (XEXP (operands[0], 0)) = 1;
  833.   #else
  834. --- 4863,4869 ----
  835.     ""
  836.     "
  837.   {
  838. !   if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
  839.   #ifdef MOTOROLA
  840.       SYMBOL_REF_FLAG (XEXP (operands[0], 0)) = 1;
  841.   #else
  842. ***************
  843. *** 4873,4879 ****
  844.        (match_operand:SI 1 "general_operand" "g"))]
  845.     ;; Operand 1 not really used on the m68000.
  846.   
  847. !   "! flag_pic"
  848.     "*
  849.   #ifdef MOTOROLA
  850.     return \"jsr %0\";
  851. --- 4878,4884 ----
  852.        (match_operand:SI 1 "general_operand" "g"))]
  853.     ;; Operand 1 not really used on the m68000.
  854.   
  855. !   "(! flag_pic || flag_pic == 3)"
  856.     "*
  857.   #ifdef MOTOROLA
  858.     return \"jsr %0\";
  859. ***************
  860. *** 4888,4894 ****
  861.        (match_operand:SI 1 "general_operand" "g"))]
  862.     ;; Operand 1 not really used on the m68000.
  863.   
  864. !   "flag_pic"
  865.     "*
  866.   #ifdef HPUX_ASM
  867.     return \"bsr %0\";
  868. --- 4893,4899 ----
  869.        (match_operand:SI 1 "general_operand" "g"))]
  870.     ;; Operand 1 not really used on the m68000.
  871.   
  872. !   "(flag_pic && flag_pic < 3)"
  873.     "*
  874.   #ifdef HPUX_ASM
  875.     return \"bsr %0\";
  876. ***************
  877. *** 4913,4919 ****
  878.     ""
  879.     "
  880.   {
  881. !   if (flag_pic && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
  882.   #ifdef MOTOROLA
  883.       SYMBOL_REF_FLAG (XEXP (operands[1], 0)) = 1;
  884.   #else
  885. --- 4918,4924 ----
  886.     ""
  887.     "
  888.   {
  889. !   if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
  890.   #ifdef MOTOROLA
  891.       SYMBOL_REF_FLAG (XEXP (operands[1], 0)) = 1;
  892.   #else
  893. ***************
  894. *** 4928,4934 ****
  895.       (call (match_operand:QI 1 "memory_operand" "o")
  896.             (match_operand:SI 2 "general_operand" "g")))]
  897.     ;; Operand 2 not really used on the m68000.
  898. !   "! flag_pic"
  899.     "*
  900.   #ifdef MOTOROLA
  901.     return \"jsr %1\";
  902. --- 4933,4939 ----
  903.       (call (match_operand:QI 1 "memory_operand" "o")
  904.             (match_operand:SI 2 "general_operand" "g")))]
  905.     ;; Operand 2 not really used on the m68000.
  906. !   "(! flag_pic || flag_pic == 3)"
  907.     "*
  908.   #ifdef MOTOROLA
  909.     return \"jsr %1\";
  910. ***************
  911. *** 4943,4949 ****
  912.       (call (match_operand:QI 1 "memory_operand" "o")
  913.             (match_operand:SI 2 "general_operand" "g")))]
  914.     ;; Operand 2 not really used on the m68000.
  915. !   "flag_pic"
  916.     "*
  917.   #ifdef HPUX_ASM
  918.     return \"bsr %1\";
  919. --- 4948,4954 ----
  920.       (call (match_operand:QI 1 "memory_operand" "o")
  921.             (match_operand:SI 2 "general_operand" "g")))]
  922.     ;; Operand 2 not really used on the m68000.
  923. !   "(flag_pic && flag_pic < 3)"
  924.     "*
  925.   #ifdef HPUX_ASM
  926.     return \"bsr %1\";
  927. diff -rc gcc-2.5.0/cp-cvt.c /net/acae127/home/bammi/usr2/gcc/cp-cvt.c
  928. *** gcc-2.5.0/cp-cvt.c    Sun Nov 28 21:58:19 1993
  929. --- /net/acae127/home/bammi/usr2/gcc/cp-cvt.c    Sun Nov 28 21:51:30 1993
  930. ***************
  931. *** 264,269 ****
  932. --- 264,272 ----
  933.       return error_mark_node;
  934.         if (binfo == NULL_TREE)
  935.       return error_not_base_type (target_type, argtype);
  936. +       if (binfo == 0) {
  937. +         return error_mark_node;
  938. +       } else
  939.         basetype = BINFO_TYPE (binfo);
  940.       }
  941.   
  942. *** gcc-2.5.0/cp-lex.c    Sun Nov 28 21:58:25 1993
  943. --- /net/acae127/home/bammi/usr2/gcc/cp-lex.c    Sun Nov 28 21:51:42 1993
  944. ***************
  945. *** 3473,3479 ****
  946.           tree type = double_type_node;
  947.           char f_seen = 0;
  948.           char l_seen = 0;
  949. !         int garbage_chars = 0, exceeds_double = 0;
  950.           REAL_VALUE_TYPE value;
  951.           jmp_buf handler;
  952.   
  953. --- 3473,3479 ----
  954.           tree type = double_type_node;
  955.           char f_seen = 0;
  956.           char l_seen = 0;
  957. !         int garbage_chars = 0;
  958.           REAL_VALUE_TYPE value;
  959.           jmp_buf handler;
  960.   
  961. ***************
  962. *** 3523,3581 ****
  963.             case 'f': case 'F':
  964.               type = float_type_node;
  965.               value = REAL_VALUE_ATOF (token_buffer, TYPE_MODE (type));
  966. -             if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  967. -             && REAL_VALUE_ISINF (value) && pedantic)
  968. -               pedwarn ("floating point number exceeds range of `float'");
  969.               garbage_chars = -1;
  970.               break;
  971.   
  972.             case 'l': case 'L':
  973.               type = long_double_type_node;
  974.               value = REAL_VALUE_ATOF (token_buffer, TYPE_MODE (type));
  975. -             if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  976. -             && REAL_VALUE_ISINF (value) && pedantic)
  977. -               pedwarn (
  978. -                    "floating point number exceeds range of `long double'");
  979.               garbage_chars = -1;
  980.               break;
  981.   
  982.             default:
  983.               value = REAL_VALUE_ATOF (token_buffer, TYPE_MODE (type));
  984. -             if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  985. -             && REAL_VALUE_ISINF (value) && pedantic)
  986. -               pedwarn ("floating point number exceeds range of `double'");
  987.             }
  988. !         set_float_handler (NULL);
  989.             }
  990.   #ifdef ERANGE
  991. !         if (errno == ERANGE && !flag_traditional && pedantic)
  992.             {
  993. !         char *p1 = token_buffer;
  994. !         /* Check for "0.0" and variants;
  995. !            SunOS 4 spuriously returns ERANGE for them.  */
  996. !         while (*p1 == '0') p1++;
  997. !         if (*p1 == '.')
  998. !             {
  999. !             p1++;
  1000. !             while (*p1 == '0') p1++;
  1001. !             }
  1002. !         if (*p1 == 'e' || *p1 == 'E')
  1003. !           {
  1004. !             /* with significand==0, ignore the exponent */
  1005. !             p1++;
  1006. !             while (*p1 != 0) p1++;
  1007. !           }
  1008. !           /* ERANGE is also reported for underflow,
  1009. !              so test the value to distinguish overflow from that.  */
  1010. !         if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  1011. !             && (REAL_VALUES_LESS (dconst1, value)
  1012. !             || REAL_VALUES_LESS (value, dconstm1)))
  1013. !           {
  1014. !             pedwarn ("floating point number exceeds range of `double'");
  1015. !             exceeds_double = 1;
  1016. !           }
  1017.             }
  1018. - #endif
  1019.           /* Note: garbage_chars is -1 if first char is *not* garbage.  */
  1020.           while (isalnum (c))
  1021.             {
  1022. --- 3523,3557 ----
  1023.             case 'f': case 'F':
  1024.               type = float_type_node;
  1025.               value = REAL_VALUE_ATOF (token_buffer, TYPE_MODE (type));
  1026.               garbage_chars = -1;
  1027.               break;
  1028.   
  1029.             case 'l': case 'L':
  1030.               type = long_double_type_node;
  1031.               value = REAL_VALUE_ATOF (token_buffer, TYPE_MODE (type));
  1032.               garbage_chars = -1;
  1033.               break;
  1034.   
  1035.             default:
  1036.               value = REAL_VALUE_ATOF (token_buffer, TYPE_MODE (type));
  1037.             }
  1038. !         set_float_handler (NULL_PTR);
  1039.             }
  1040. +         if (pedantic
  1041. +         && (REAL_VALUE_ISINF (value)
  1042.   #ifdef ERANGE
  1043. !             || (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
  1044. !             && errno == ERANGE
  1045. !             /* ERANGE is also reported for underflow, so test the
  1046. !                value to distinguish overflow from that.  */
  1047. !             && (REAL_VALUES_LESS (dconst1, value)
  1048. !                 || REAL_VALUES_LESS (value, dconstm1)))
  1049. ! #endif
  1050. !             ))
  1051.             {
  1052. !         pedwarn ("floating point number exceeds range of `%s'",
  1053. !              IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))));
  1054.             }
  1055.           /* Note: garbage_chars is -1 if first char is *not* garbage.  */
  1056.           while (isalnum (c))
  1057.             {
  1058. *** gcc-2.5.0/cp-parse.y    Sun Nov 28 21:58:27 1993
  1059. --- /net/acae127/home/bammi/usr2/gcc/cp-parse.y    Sun Nov 28 21:58:36 1993
  1060. ***************
  1061. *** 1127,1134 ****
  1062.             else if (TREE_CODE ($2) == TREE_LIST)
  1063.                   {
  1064.                 tree t = TREE_VALUE ($2);
  1065. !               if (t != NULL_TREE
  1066. !               && TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE)
  1067.               pedwarn ("ANSI C++ forbids using sizeof() on a function");
  1068.               }
  1069.             $$ = c_sizeof (TREE_TYPE ($2)); }
  1070. --- 1127,1134 ----
  1071.             else if (TREE_CODE ($2) == TREE_LIST)
  1072.                   {
  1073.                 tree t = TREE_VALUE ($2);
  1074. !               if (t != NULL_TREE && 
  1075. !                   ((TREE_TYPE( t) == 0) || TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE))
  1076.               pedwarn ("ANSI C++ forbids using sizeof() on a function");
  1077.               }
  1078.             $$ = c_sizeof (TREE_TYPE ($2)); }
  1079. ***************
  1080. *** 1919,1924 ****
  1081. --- 1919,1935 ----
  1082.           warning ("`%s' attribute directive ignored",
  1083.                IDENTIFIER_POINTER ($1));
  1084.         $$ = $1; }
  1085. +     | TYPE_QUAL
  1086. +     | IDENTIFIER '(' IDENTIFIER ')'
  1087. +     { /* If not "mode (m)", then issue warning.  */
  1088. +       if (strcmp (IDENTIFIER_POINTER ($1), "mode") != 0)
  1089. +         {
  1090. +           warning ("`%s' attribute directive ignored",
  1091. +                IDENTIFIER_POINTER ($1));
  1092. +           $$ = $1;
  1093. +         }
  1094. +       else
  1095. +         $$ = tree_cons ($1, $3, NULL_TREE); }
  1096.       | IDENTIFIER '(' CONSTANT ')'
  1097.       { /* if not "aligned(n)", then issue warning */
  1098.         if (strcmp (IDENTIFIER_POINTER ($1), "aligned") != 0
  1099. diff -rc gcc-2.5.0/cp-tree.c /net/acae127/home/bammi/usr2/gcc/cp-tree.c
  1100. *** gcc-2.5.0/cp-tree.c    Sun Nov 28 21:58:29 1993
  1101. --- /net/acae127/home/bammi/usr2/gcc/cp-tree.c    Sun Nov 28 21:51:47 1993
  1102. ***************
  1103. *** 1672,1677 ****
  1104. --- 1672,1678 ----
  1105.     print_class_statistics ();
  1106.   }
  1107.   
  1108. + #ifndef atarist
  1109.   /* This is used by the `assert' macro.  It is provided in libgcc.a,
  1110.      which `cc' doesn't know how to link.  Note that the C++ front-end
  1111.      no longer actually uses the `assert' macro (instead, it calls
  1112. ***************
  1113. *** 1694,1699 ****
  1114. --- 1695,1701 ----
  1115.     fflush (stderr);
  1116.     abort ();
  1117.   }
  1118. + #endif
  1119.   
  1120.   /* Return, as an INTEGER_CST node, the number of elements for
  1121.      TYPE (which is an ARRAY_TYPE).  This counts only elements of the top array. */
  1122. *** gcc-2.5.0/dbxout.c    Fri Nov 19 09:35:58 1993
  1123. --- /net/acae127/home/bammi/usr2/gcc/dbxout.c    Fri Nov 19 09:44:38 1993
  1124. ***************
  1125. *** 471,476 ****
  1126. --- 471,482 ----
  1127.        and output them all, except for those already output.  */
  1128.   
  1129.     dbxout_typedefs (syms);
  1130. +   /* Make sure that gdb extensions, if desired, are used immediately for C++. */
  1131. +   if (use_gnu_debug_info_extensions
  1132. +       && strcmp (lang_identify (), "cplusplus") == 0)
  1133. +     have_used_extensions = 1;
  1134.   }
  1135.   
  1136.   /* Output any typedef names for types described by TYPE_DECLs in SYMS,
  1137. *** gcc-2.5.0/gcc.c    Sun Nov 28 21:58:40 1993
  1138. --- /net/acae127/home/bammi/usr2/gcc/gcc.c    Sun Nov 28 21:52:04 1993
  1139. ***************
  1140. *** 30,35 ****
  1141. --- 30,44 ----
  1142.   Once it knows which kind of compilation to perform, the procedure for
  1143.   compilation is specified by a string called a "spec".  */
  1144.   
  1145. + #ifdef CROSSATARI
  1146. + #ifdef atarist
  1147. + #undef atarist
  1148. + #endif
  1149. + #ifdef atariminix
  1150. + #undef atariminix
  1151. + #endif
  1152. + #endif
  1153. +   
  1154.   #include <sys/types.h>
  1155.   #include <ctype.h>
  1156.   #include <signal.h>
  1157. ***************
  1158. *** 40,45 ****
  1159. --- 49,56 ----
  1160.   #include "obstack.h"
  1161.   #include "gvarargs.h"
  1162.   #include <stdio.h>
  1163. + #include <string.h>
  1164. +     /* if your supplier still does'nt have string.h, shoot him.. */
  1165.   
  1166.   #ifndef R_OK
  1167.   #define R_OK 4
  1168. ***************
  1169. *** 65,71 ****
  1170.   #define NULL_PTR ((GENERIC_PTR)0)
  1171.   #endif
  1172.   
  1173. ! #ifdef USG
  1174.   #define vfork fork
  1175.   #endif /* USG */
  1176.   
  1177. --- 76,82 ----
  1178.   #define NULL_PTR ((GENERIC_PTR)0)
  1179.   #endif
  1180.   
  1181. ! #if (defined(USG) || defined(atariminix))
  1182.   #define vfork fork
  1183.   #endif /* USG */
  1184.   
  1185. ***************
  1186. *** 97,102 ****
  1187. --- 108,124 ----
  1188.   #define PATH_SEPARATOR ':'
  1189.   #endif
  1190.   
  1191. + #ifdef CROSSATARI
  1192. + #include <ctype.h>
  1193. + #endif
  1194. + #ifdef atarist
  1195. + #include <osbind.h>
  1196. + #include <ctype.h>
  1197. + #include <fcntl.h>        /* fgth, for redirection of stderr */
  1198. + long _stksize = 8192;
  1199. + #endif
  1200.   #define obstack_chunk_alloc xmalloc
  1201.   #define obstack_chunk_free free
  1202.   
  1203. ***************
  1204. *** 161,167 ****
  1205. --- 183,191 ----
  1206.      pass the compiler in building the list of pointers to constructors
  1207.      and destructors.  */
  1208.   
  1209. + #if (!(defined(CROSSATARI) || defined(atarist)))
  1210.   static struct obstack collect_obstack;
  1211. + #endif
  1212.   
  1213.   extern char *version_string;
  1214.   
  1215. ***************
  1216. *** 462,468 ****
  1217.              %{aux-info*}\
  1218.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1219.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1220. !               %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1221.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1222.                         %{!pipe:%g.s} %A\n }}}}"},
  1223.     {"-",
  1224. --- 486,492 ----
  1225.              %{aux-info*}\
  1226.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1227.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1228. !               %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1229.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1230.                         %{!pipe:%g.s} %A\n }}}}"},
  1231.     {"-",
  1232. ***************
  1233. *** 497,503 ****
  1234.              %{aux-info*}\
  1235.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1236.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1237. !               %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1238.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1239.                         %{!pipe:%g.s} %A\n }}}}"},
  1240.     {".h", "@c-header"},
  1241. --- 521,527 ----
  1242.              %{aux-info*}\
  1243.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1244.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1245. !               %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1246.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1247.                         %{!pipe:%g.s} %A\n }}}}"},
  1248.     {".h", "@c-header"},
  1249. ***************
  1250. *** 533,539 ****
  1251.              %{aux-info*}\
  1252.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1253.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1254. !               %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1255.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1256.                         %{!pipe:%g.s} %A\n }}}}"},
  1257.     {".i", "@cpp-output"},
  1258. --- 557,563 ----
  1259.              %{aux-info*}\
  1260.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1261.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1262. !               %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1263.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1264.                         %{!pipe:%g.s} %A\n }}}}"},
  1265.     {".i", "@cpp-output"},
  1266. ***************
  1267. *** 544,550 ****
  1268.       %{aux-info*}\
  1269.       %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1270.       %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1271. !     %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1272.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o} %{!pipe:%g.s} %A\n }"},
  1273.     {".ii", "@c++-cpp-output"},
  1274.     {"@c++-cpp-output",
  1275. --- 568,574 ----
  1276.       %{aux-info*}\
  1277.       %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1278.       %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1279. !     %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1280.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o} %{!pipe:%g.s} %A\n }"},
  1281.     {".ii", "@c++-cpp-output"},
  1282.     {"@c++-cpp-output",
  1283. ***************
  1284. *** 554,567 ****
  1285.           %{aux-info*}\
  1286.           %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1287.           %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1288. !        %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1289.              %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1290.              %{!pipe:%g.s} %A\n }"},
  1291.     {".s", "@assembler"},
  1292.     {"@assembler",
  1293. !    "%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1294.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o} %i %A\n }"},
  1295.     {".S", "@assembler-with-cpp"},
  1296.     {"@assembler-with-cpp",
  1297.      "cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
  1298.       %{C:%{!E:%eGNU C does not support -C without using -E}}\
  1299. --- 578,594 ----
  1300.           %{aux-info*}\
  1301.           %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  1302.           %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  1303. !        %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1304.              %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1305.              %{!pipe:%g.s} %A\n }"},
  1306.     {".s", "@assembler"},
  1307.     {"@assembler",
  1308. !    "%{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1309.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o} %i %A\n }"},
  1310.     {".S", "@assembler-with-cpp"},
  1311. +   {".ss", "@assembler-with-cpp"},
  1312. +   {".cpp", "@assembler-with-cpp"},
  1313. +   {".spp", "@assembler-with-cpp"},
  1314.     {"@assembler-with-cpp",
  1315.      "cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
  1316.       %{C:%{!E:%eGNU C does not support -C without using -E}}\
  1317. ***************
  1318. *** 571,577 ****
  1319.           %{traditional-cpp:-traditional}\
  1320.       %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*}\
  1321.           %i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
  1322. !    "%{!M:%{!MM:%{!E:%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1323.                       %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1324.               %{!pipe:%g.s} %A\n }}}}"},
  1325.     {".ads", "@ada"},
  1326. --- 598,604 ----
  1327.           %{traditional-cpp:-traditional}\
  1328.       %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*}\
  1329.           %i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
  1330. !    "%{!M:%{!MM:%{!E:%{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  1331.                       %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  1332.               %{!pipe:%g.s} %A\n }}}}"},
  1333.     {".ads", "@ada"},
  1334. ***************
  1335. *** 597,602 ****
  1336. --- 624,638 ----
  1337.   
  1338.   /* Here is the spec for running the linker, after compiling all files.  */
  1339.   
  1340. + #if (defined(CROSSATARI) || defined(atarist) || defined(atariminix))
  1341. + static char *link_command_spec = 
  1342. +  "%{!fsyntax-only: \
  1343. +     %{!c:%{!M:%{!MM:%{!E:%{!S:ld %l %X %{v} %{G} %{o*} \
  1344. +       %{A} %{d} %{e*} %{N} %{n} %{r} %{s} %{t} %{u*} %{x} %{z}\
  1345. +       %{!A:%{!nostartfiles:%{!nostdlib:%S}}} %{static:}\
  1346. +       %{L*} %{T*} %o %{!nostdlib:%L}\n }}}}}}";
  1347. + #else
  1348.   /* -u* was put back because both BSD and SysV seem to support it.  */
  1349.   /* %{static:} simply prevents an error message if the target machine
  1350.      doesn't handle -static.  */
  1351. ***************
  1352. *** 630,635 ****
  1353. --- 666,672 ----
  1354.               %{L*} %D %{T*} %o %{!nostdlib:-lgcc %L -lgcc %{!A:%E}}\n }}}}}}";
  1355.   #endif
  1356.   #endif
  1357. + #endif
  1358.   
  1359.   /* A vector of options to give to the linker.
  1360.      These options are accumulated by -Xlinker and -Wl,
  1361. ***************
  1362. *** 857,862 ****
  1363. --- 894,900 ----
  1364.     *argcp = newindex;
  1365.   }
  1366.   
  1367. + #if (!(defined(atarist) || defined(CROSSATARI) || defined(atariminix)))
  1368.   /* Read compilation specs from a file named FILENAME,
  1369.      replacing the default ones.
  1370.   
  1371. ***************
  1372. *** 996,1001 ****
  1373. --- 1034,1040 ----
  1374.   
  1375.     return p;
  1376.   }
  1377. + #endif /* ataris */
  1378.   
  1379.   /* Structure to keep track of the specs that have been defined so far.  These
  1380.      are accessed using %(specname) or %[specname] in a compiler or link spec. */
  1381. ***************
  1382. *** 1112,1117 ****
  1383. --- 1151,1163 ----
  1384.   /* Name with which this program was invoked.  */
  1385.   
  1386.   static char *programname;
  1387. + #ifdef atarist
  1388. + /* Flag indicating, that stderr should be redirected for the child
  1389. +    processes */
  1390. + unsigned char zflag;
  1391. + #endif
  1392.   
  1393.   /* Structures to keep track of prefixes to try when looking for files. */
  1394.   
  1395. ***************
  1396. *** 1405,1414 ****
  1397.     if (base == (char *)0)
  1398.       base = "./";
  1399.   
  1400.     len = strlen (base);
  1401.     temp_filename = xmalloc (len + sizeof("/ccXXXXXX") + 1);
  1402.     strcpy (temp_filename, base);
  1403. !   if (len > 0 && temp_filename[len-1] != '/')
  1404.       temp_filename[len++] = '/';
  1405.     strcpy (temp_filename + len, "ccXXXXXX");
  1406.   
  1407. --- 1451,1471 ----
  1408.     if (base == (char *)0)
  1409.       base = "./";
  1410.   
  1411. + #ifdef atarist
  1412. +   {
  1413. +       char *newbase = alloca(FILENAME_MAX);
  1414. +       dos2unx(base,newbase);
  1415. +       base = newbase;
  1416. +   }
  1417. + #endif
  1418.     len = strlen (base);
  1419.     temp_filename = xmalloc (len + sizeof("/ccXXXXXX") + 1);
  1420.     strcpy (temp_filename, base);
  1421. !   if (len > 0 && (temp_filename[len-1] != '/' 
  1422. ! #ifdef atarist
  1423. !           || temp_filename[len-1] != '\\'
  1424. ! #endif
  1425. !            ))
  1426.       temp_filename[len++] = '/';
  1427.     strcpy (temp_filename + len, "ccXXXXXX");
  1428.   
  1429. ***************
  1430. *** 1427,1432 ****
  1431. --- 1484,1490 ----
  1432.      use come from an obstack, we don't have to worry about allocating
  1433.      space for them.  */
  1434.   
  1435. + #if (!(defined(CROSSATARI) || defined(atarist)))
  1436.   #ifndef HAVE_PUTENV
  1437.   
  1438.   void
  1439. ***************
  1440. *** 1528,1533 ****
  1441. --- 1586,1592 ----
  1442.     obstack_1grow (&collect_obstack, '\0');
  1443.     putenv (obstack_finish (&collect_obstack));
  1444.   }
  1445. + #endif /* ataris */
  1446.   
  1447.   
  1448.   /* Search for NAME using the prefix list PREFIXES.  MODE is passed to
  1449. ***************
  1450. *** 1812,1817 ****
  1451. --- 1871,1877 ----
  1452.   
  1453.   #else /* not __MSDOS__ */
  1454.   
  1455. + #ifndef atarist
  1456.   static int
  1457.   pexecute (search_flag, program, argv, not_last)
  1458.        int search_flag;
  1459. ***************
  1460. *** 1900,1905 ****
  1461. --- 1960,1966 ----
  1462.       }
  1463.   }
  1464.   
  1465. + #endif /* not atarist */
  1466.   #endif /* not __MSDOS__ */
  1467.   #else /* not OS2 */
  1468.   
  1469. ***************
  1470. *** 1930,1945 ****
  1471.       {
  1472.         char *prog;        /* program name.  */
  1473.         char **argv;        /* vector of args.  */
  1474.         int pid;            /* pid of process for this command.  */
  1475.       };
  1476.   
  1477.     struct command *commands;    /* each command buffer with above info.  */
  1478.   
  1479.     /* Count # of piped commands.  */
  1480.     for (n_commands = 1, i = 0; i < argbuf_index; i++)
  1481.       if (strcmp (argbuf[i], "|") == 0)
  1482.         n_commands++;
  1483.     /* Get storage for each command.  */
  1484.     commands
  1485.       = (struct command *) alloca (n_commands * sizeof (struct command));
  1486. --- 1991,2011 ----
  1487.       {
  1488.         char *prog;        /* program name.  */
  1489.         char **argv;        /* vector of args.  */
  1490. + #ifndef atarist
  1491.         int pid;            /* pid of process for this command.  */
  1492. + #endif
  1493.       };
  1494.   
  1495.     struct command *commands;    /* each command buffer with above info.  */
  1496.   
  1497. + #ifndef atarist
  1498.     /* Count # of piped commands.  */
  1499.     for (n_commands = 1, i = 0; i < argbuf_index; i++)
  1500.       if (strcmp (argbuf[i], "|") == 0)
  1501.         n_commands++;
  1502. ! #else
  1503. !   n_commands = 1;
  1504. ! #endif
  1505.     /* Get storage for each command.  */
  1506.     commands
  1507.       = (struct command *) alloca (n_commands * sizeof (struct command));
  1508. ***************
  1509. *** 1954,1959 ****
  1510. --- 2020,2026 ----
  1511.     if (string)
  1512.       commands[0].argv[0] = string;
  1513.   
  1514. + #ifndef atarist
  1515.     for (n_commands = 1, i = 0; i < argbuf_index; i++)
  1516.       if (strcmp (argbuf[i], "|") == 0)
  1517.         {                /* each command.  */
  1518. ***************
  1519. *** 1968,1973 ****
  1520. --- 2035,2043 ----
  1521.         commands[n_commands].argv[0] = string;
  1522.       n_commands++;
  1523.         }
  1524. + #else
  1525. +   n_commands = 1;
  1526. + #endif
  1527.   
  1528.     argbuf[argbuf_index] = 0;
  1529.   
  1530. ***************
  1531. *** 1983,1991 ****
  1532. --- 2053,2063 ----
  1533.         for (j = commands[i].argv; *j; j++)
  1534.           fprintf (stderr, " %s", *j);
  1535.   
  1536. + #ifndef atarist
  1537.         /* Print a pipe symbol after all but the last command.  */
  1538.         if (i + 1 != n_commands)
  1539.           fprintf (stderr, " |");
  1540. + #endif
  1541.         fprintf (stderr, "\n");
  1542.       }
  1543.         fflush (stderr);
  1544. ***************
  1545. *** 2000,2016 ****
  1546. --- 2072,2098 ----
  1547.   #endif /* DEBUG */
  1548.       }
  1549.   
  1550. + #ifndef atarist
  1551.     /* Run each piped subprocess.  */
  1552.   
  1553.     last_pipe_input = STDIN_FILE_NO;
  1554.     for (i = 0; i < n_commands; i++)
  1555.       {
  1556. + #ifndef atariminix
  1557.         char *string = commands[i].argv[0];
  1558.   
  1559.         commands[i].pid = pexecute (string != commands[i].prog,
  1560.                     string, commands[i].argv,
  1561.                     i + 1 < n_commands);
  1562.   
  1563. + #else
  1564. +       extern int execv();
  1565. +       char *string = commands[i].argv[0];
  1566. +       commands[i].pid = pexecute (execv,
  1567. +                   string, commands[i].argv,
  1568. +                   i + 1 < n_commands);
  1569. + #endif
  1570.         if (string != commands[i].prog)
  1571.       free (string);
  1572.       }
  1573. ***************
  1574. *** 2057,2062 ****
  1575. --- 2139,2189 ----
  1576.         }
  1577.       return ret_code;
  1578.     }
  1579. + #else /* atarist */
  1580. +  {
  1581. +      register int iii;
  1582. +      int errfd, oldfd;
  1583. +      char **j;
  1584. +      execution_count++;
  1585. +      if (zflag)
  1586. +        {
  1587. +      errfd = Fopen("compile.err", 2);
  1588. +      if (errfd < __SMALLEST_VALID_HANDLE)
  1589. +        errfd = Fcreate("compile.err", 0);
  1590. +      else
  1591. +        Fseek(0L, errfd, 2);
  1592. +      if (errfd >= __SMALLEST_VALID_HANDLE)
  1593. +        {
  1594. +          oldfd = Fdup (2);
  1595. +          Fforce(2, errfd);
  1596. +        }
  1597. +      else
  1598. +        {
  1599. +          error("cannot open %s", "compile.err");
  1600. +          zflag = 0;        /* no redirection */
  1601. +        }
  1602. +        }
  1603. +      for (i = 0; i < n_commands ; i++)
  1604. +      {
  1605. +          j = commands[i].argv;
  1606. +          iii = spawnve(0, j[0], j, NULL);
  1607. +      if(iii != 0)
  1608. +          break;
  1609. +      }
  1610. +      if (zflag)
  1611. +        {
  1612. +      Fforce(2, oldfd);
  1613. +      Fclose(oldfd);
  1614. +      Fclose(errfd);
  1615. +        }
  1616. +      if (iii != 0)
  1617. +        return -1;
  1618. +      else
  1619. +        return 0;
  1620. +  }
  1621. + #endif /* atarist */  
  1622.   }
  1623.   
  1624.   /* Find all the switches given to us
  1625. ***************
  1626. *** 2120,2125 ****
  1627. --- 2247,2253 ----
  1628.   
  1629.     /* Set up the default search paths.  */
  1630.   
  1631. + #ifndef CROSSATARI
  1632.     if (gcc_exec_prefix)
  1633.       {
  1634.         add_prefix (&exec_prefix, gcc_exec_prefix, 0, 0, NULL_PTR);
  1635. ***************
  1636. *** 2194,2199 ****
  1637. --- 2322,2328 ----
  1638.           endp++;
  1639.       }
  1640.       }
  1641. + #endif /* CROSSATARI */
  1642.   
  1643.     /* Use LPATH like LIBRARY_PATH (for the CMU build program).  */
  1644.     temp = getenv ("LPATH");
  1645. ***************
  1646. *** 2402,2407 ****
  1647. --- 2531,2542 ----
  1648.             n_switches++;
  1649.             break;
  1650.           }
  1651. + #ifdef atarist
  1652. +         case 'z':    /* redirect stderr to a file */
  1653. +           zflag++;
  1654. +           n_switches++;
  1655. +           break;
  1656. + #endif
  1657.           default:
  1658.             n_switches++;
  1659.   
  1660. ***************
  1661. *** 2421,2431 ****
  1662. --- 2556,2577 ----
  1663.        (such as cpp) rather than those of the host system.  */
  1664.     /* Use 2 as fourth arg meaning try just the machine as a suffix,
  1665.        as well as trying the machine and the version.  */
  1666. + #if (defined(atarist) || defined(CROSSATARI) || defined(WEIRD))
  1667. + /* NB defined(WEIRD) should not really be there, its only for my weird setup */
  1668. +   /* We are not using machine_suffix here, so do not make */
  1669. +   /* these prefixes available only when we have one       */
  1670. +   add_prefix (&exec_prefix, standard_exec_prefix, 0, 0, NULL_PTR);
  1671. +   add_prefix (&exec_prefix, standard_exec_prefix_1, 0, 0, NULL_PTR);
  1672. +   add_prefix (&startfile_prefix, standard_exec_prefix, 0, 0, NULL_PTR);
  1673. +   add_prefix (&startfile_prefix, standard_exec_prefix_1, 0, 0, NULL_PTR);
  1674. + #else
  1675.     add_prefix (&exec_prefix, standard_exec_prefix, 0, 2, NULL_PTR);
  1676.     add_prefix (&exec_prefix, standard_exec_prefix_1, 0, 2, NULL_PTR);
  1677.   
  1678.     add_prefix (&startfile_prefix, standard_exec_prefix, 0, 1, NULL_PTR);
  1679.     add_prefix (&startfile_prefix, standard_exec_prefix_1, 0, 1, NULL_PTR);
  1680. + #endif /* (defined(atarist) || defined(CROSSATARI)) */
  1681.   
  1682.     tooldir_prefix = concat (tooldir_base_prefix, spec_machine, "/");
  1683.   
  1684. ***************
  1685. *** 2667,2674 ****
  1686. --- 2813,2822 ----
  1687.        If -pipe, this forces out the last command if it ended in `|'.  */
  1688.     if (value == 0)
  1689.       {
  1690. + #ifndef atarist
  1691.         if (argbuf_index > 0 && !strcmp (argbuf[argbuf_index - 1], "|"))
  1692.       argbuf_index--;
  1693. + #endif
  1694.   
  1695.         if (argbuf_index > 0)
  1696.       value = execute ();
  1697. ***************
  1698. *** 2706,2711 ****
  1699. --- 2854,2903 ----
  1700.          Otherwise, NL, SPC, TAB and % are special.  */
  1701.       switch (inswitch ? 'a' : c)
  1702.         {
  1703. + #if (defined(atarist) || defined(CROSSATARI))
  1704. + /* this stuff added by jrd.  if see '$', expect name of env var, delimited
  1705. +    by '$'.  Find it's value, and subst it in.
  1706. +    modified by ERS to only collect things that look like names; this
  1707. +    saves e.g. the -$ arg. to cpp from getting munged */
  1708. +       case '$':
  1709. +       {
  1710. +     char varname[32];        /* should be enough */
  1711. +     char * value;            /* deciphered value string */
  1712. +     char *temp;
  1713. +     int i;
  1714. +     extern char *getenv();
  1715. +     
  1716. +     for (i = 0 ; ((c = *p) != '$') && isalnum(c) && i < 31 ; i++, p++)
  1717. +         varname[i] = c;
  1718. +     varname[i] = '\0';
  1719. +     if (i > 0) /* ++jrb fix */
  1720. +     {
  1721. +                  ++p;    /* skip trailing '$' */
  1722. +         value = getenv(varname); /* ++jrb fix */
  1723. +         if (value)
  1724. +         { /* if value is a path, only consider 1'st component */
  1725. + #ifdef atarist
  1726. +             if((temp = index(value, ',')) == NULL)
  1727. +                 temp = index(value, ';');
  1728. + #else
  1729. +             temp = index(value, ':');
  1730. + #endif
  1731. +             obstack_grow (&obstack, value,
  1732. +                       temp ? temp - value : strlen (value));
  1733. +         }
  1734. +         else
  1735. +           obstack_1grow (&obstack, '.'); /* a complete kludge... */
  1736. +     }
  1737. +         else
  1738. +         {
  1739. +              obstack_1grow(&obstack, '$');
  1740. +         }
  1741. +     arg_going = 1;
  1742. +       }
  1743. +      break;
  1744. + #endif /* atarist */
  1745.         case '\n':
  1746.       /* End of line: finish any pending argument,
  1747.          then run the pending command if one has been started.  */
  1748. ***************
  1749. *** 3380,3392 ****
  1750. --- 3572,3592 ----
  1751.           break;
  1752.   
  1753.         default:
  1754. + #if 1 /* atarist */
  1755. +         fprintf(stderr, "Bogus char '%c' found at pos %d of spec '%s'\n",
  1756. +         c, (p - spec - 1), spec);
  1757. + #endif
  1758.           abort ();
  1759.         }
  1760.       break;
  1761.   
  1762. + #ifndef atarist
  1763. +       /* on the atari it is important to preserve backslash in spec */
  1764. +       /* so just let it go into default case */
  1765.         case '\\':
  1766.       /* Backslash: treat next character as ordinary.  */
  1767.       c = *p++;
  1768. + #endif
  1769.   
  1770.       /* fall through */
  1771.         default:
  1772. ***************
  1773. *** 3663,3668 ****
  1774. --- 3863,3869 ----
  1775.   
  1776.   /* On fatal signals, delete all the temporary files.  */
  1777.   
  1778. + #ifndef atarist
  1779.   static void
  1780.   fatal_error (signum)
  1781.        int signum;
  1782. ***************
  1783. *** 3674,3679 ****
  1784. --- 3875,3881 ----
  1785.        so its normal effect occurs.  */
  1786.     kill (getpid (), signum);
  1787.   }
  1788. + #endif
  1789.   
  1790.   int
  1791.   main (argc, argv)
  1792. ***************
  1793. *** 3688,3693 ****
  1794. --- 3890,3900 ----
  1795.     char *specs_file;
  1796.     char *p;
  1797.   
  1798. + #ifdef atarist
  1799. + /* turn this on if you are going to set the TOS 1.4 dont clear heap flag */
  1800. + /*  _malloczero(1); */     /* zero mallocs by default */
  1801. +   programname = "gcc";
  1802. + #else  
  1803.     p = argv[0] + strlen (argv[0]);
  1804.     while (p != argv[0] && p[-1] != '/') --p;
  1805.     programname = p;
  1806. ***************
  1807. *** 3704,3715 ****
  1808. --- 3911,3924 ----
  1809.     if (signal (SIGPIPE, SIG_IGN) != SIG_IGN)
  1810.       signal (SIGPIPE, fatal_error);
  1811.   #endif
  1812. + #endif /* atarist */
  1813.   
  1814.     argbuf_length = 10;
  1815.     argbuf = (char **) xmalloc (argbuf_length * sizeof (char *));
  1816.   
  1817.     obstack_init (&obstack);
  1818.   
  1819. + #if (!(defined(atarist) || defined(CROSSATARI)))
  1820.     /* Set up to remember the pathname of gcc and any options
  1821.        needed for collect.  We use argv[0] instead of programname because
  1822.        we need the complete pathname.  */
  1823. ***************
  1824. *** 3717,3722 ****
  1825. --- 3926,3932 ----
  1826.     obstack_grow (&collect_obstack, "COLLECT_GCC=", sizeof ("COLLECT_GCC=")-1);
  1827.     obstack_grow (&collect_obstack, argv[0], strlen (argv[0])+1);
  1828.     putenv (obstack_finish (&collect_obstack));
  1829. + #endif
  1830.   
  1831.     /* Choose directory for temp files.  */
  1832.   
  1833. ***************
  1834. *** 3728,3733 ****
  1835. --- 3938,3952 ----
  1836.   
  1837.     process_command (argc, argv);
  1838.   
  1839. + #if (defined(atarist) || defined(CROSSATARI))
  1840. +   {
  1841. +     char *temp;
  1842. +     
  1843. +     if((temp = getenv ("GCCEXEC")))
  1844. +     add_prefix (&exec_prefix, temp, 0, 0, 0);
  1845. +   }
  1846. + #endif
  1847. +   
  1848.     /* Initialize the vector of specs to just the default.
  1849.        This means one element containing 0s, as a terminator.  */
  1850.   
  1851. ***************
  1852. *** 3735,3740 ****
  1853. --- 3954,3963 ----
  1854.     bcopy (default_compilers, compilers, sizeof default_compilers);
  1855.     n_compilers = n_default_compilers;
  1856.   
  1857. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  1858. +   specs_file = 0;
  1859. + #else
  1860.     /* Read specs from a file if there is one.  */
  1861.   
  1862.     machine_suffix = concat (spec_machine, "/", concat (spec_version, "/", ""));
  1863. ***************
  1864. *** 3744,3749 ****
  1865. --- 3967,3973 ----
  1866.     /* Read the specs file unless it is a default one.  */
  1867.     if (specs_file != 0 && strcmp (specs_file, "specs"))
  1868.       read_specs (specs_file);
  1869. + #endif
  1870.   
  1871.     /* If not cross-compiling, look for startfiles in the standard places.  */
  1872.     /* The fact that these are done here, after reading the specs file,
  1873. ***************
  1874. *** 3781,3787 ****
  1875.               0, 0, NULL_PTR);
  1876.         add_prefix (&startfile_prefix,
  1877.                 concat (standard_exec_prefix,
  1878. !                   machine_suffix,
  1879.                     standard_startfile_prefix),
  1880.                 0, 0, NULL_PTR);
  1881.       }               
  1882. --- 4005,4011 ----
  1883.               0, 0, NULL_PTR);
  1884.         add_prefix (&startfile_prefix,
  1885.                 concat (standard_exec_prefix,
  1886. !                   (machine_suffix)? machine_suffix : "",
  1887.                     standard_startfile_prefix),
  1888.                 0, 0, NULL_PTR);
  1889.       }               
  1890. ***************
  1891. *** 3816,3822 ****
  1892. --- 4040,4052 ----
  1893.   
  1894.     if (verbose_flag)
  1895.       {
  1896. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  1897. + #include "PatchLev.h"
  1898. +       fprintf (stderr, "gcc-atariST version %s Patchlevel %s\n",
  1899. +            version_string, PatchLevel);
  1900. + #else
  1901.         fprintf (stderr, "gcc version %s\n", version_string);
  1902. + #endif
  1903.         if (n_infiles == 0)
  1904.       exit (0);
  1905.       }
  1906. ***************
  1907. *** 3864,3870 ****
  1908. --- 4094,4105 ----
  1909.   
  1910.         input_basename = input_filename;
  1911.         for (p = input_filename; *p; p++)
  1912. + #ifdef atarist
  1913. +         if (((*p == '/') || (*p == '\\')) && (*(p-1) != ':'))
  1914. +             /* allow both '\' and '/' with  our new lib */
  1915. + #else
  1916.           if (*p == '/')
  1917. + #endif
  1918.             input_basename = p + 1;
  1919.   
  1920.         /* Find a suffix starting with the last period,
  1921. ***************
  1922. *** 3927,3932 ****
  1923. --- 4162,4168 ----
  1924.         int i;
  1925.         int first_time;
  1926.   
  1927. + #if (!(defined(atarist) || defined(CROSSATARI)))
  1928.         /* Rebuild the COMPILER_PATH and LIBRARY_PATH environment variables
  1929.        for collect.  */
  1930.         putenv_from_prefixes (&exec_prefix, "COMPILER_PATH=");
  1931. ***************
  1932. *** 3957,3962 ****
  1933. --- 4193,4199 ----
  1934.       }
  1935.         obstack_grow (&collect_obstack, "\0", 1);
  1936.         putenv (obstack_finish (&collect_obstack));
  1937. + #endif
  1938.   
  1939.         value = do_spec (link_command_spec);
  1940.         if (value < 0)
  1941. *** gcc-2.5.0/getpwd.c    Tue Sep 21 17:35:41 1993
  1942. --- /net/acae127/home/bammi/usr2/gcc/getpwd.c    Fri May 21 08:35:37 1993
  1943. ***************
  1944. *** 14,20 ****
  1945.      BSD systems) now provides getcwd as called for by POSIX.  Allow for
  1946.      the few exceptions to the general rule here.  */
  1947.   
  1948. ! #if !(defined (POSIX) || defined (USG) || defined (VMS))
  1949.   #include <sys/param.h>
  1950.   extern char *getwd ();
  1951.   #define getcwd(buf,len) getwd(buf)
  1952. --- 14,20 ----
  1953.      BSD systems) now provides getcwd as called for by POSIX.  Allow for
  1954.      the few exceptions to the general rule here.  */
  1955.   
  1956. ! #if !(defined (POSIX) || defined (USG) || defined (VMS) || defined(atarist) || defined(CROSSHPUX))
  1957.   #include <sys/param.h>
  1958.   extern char *getwd ();
  1959.   #define getcwd(buf,len) getwd(buf)
  1960. ***************
  1961. *** 48,58 ****
  1962.     if (!p && !(errno = failure_errno))
  1963.       {
  1964.         if (! ((p = getenv ("PWD")) != 0
  1965.            && *p == '/'
  1966.            && stat (p, &pwdstat) == 0
  1967.            && stat (".", &dotstat) == 0
  1968.            && dotstat.st_ino == pwdstat.st_ino
  1969. !          && dotstat.st_dev == pwdstat.st_dev))
  1970.   
  1971.       /* The shortcut didn't work.  Try the slow, ``sure'' way.  */
  1972.       for (s = GUESSPATHLEN;  ! getcwd (p = xmalloc (s), s);  s *= 2)
  1973. --- 48,61 ----
  1974.     if (!p && !(errno = failure_errno))
  1975.       {
  1976.         if (! ((p = getenv ("PWD")) != 0
  1977. + #ifndef atarist
  1978.            && *p == '/'
  1979.            && stat (p, &pwdstat) == 0
  1980.            && stat (".", &dotstat) == 0
  1981.            && dotstat.st_ino == pwdstat.st_ino
  1982. !          && dotstat.st_dev == pwdstat.st_dev
  1983. ! #endif
  1984. !          ))
  1985.   
  1986.       /* The shortcut didn't work.  Try the slow, ``sure'' way.  */
  1987.       for (s = GUESSPATHLEN;  ! getcwd (p = xmalloc (s), s);  s *= 2)
  1988. *** gcc-2.5.0/toplev.c    Mon Nov  1 13:14:32 1993
  1989. --- /net/acae127/home/bammi/usr2/gcc/toplev.c    Thu Nov  4 11:41:41 1993
  1990. ***************
  1991. *** 31,37 ****
  1992.   
  1993.   #include <sys/stat.h>
  1994.   
  1995. ! #ifdef USG
  1996.   #undef FLOAT
  1997.   #include <sys/param.h>
  1998.   /* This is for hpux.  It is a real screw.  They should change hpux.  */
  1999. --- 31,37 ----
  2000.   
  2001.   #include <sys/stat.h>
  2002.   
  2003. ! #if defined(USG) || defined(CROSSHPUX)
  2004.   #undef FLOAT
  2005.   #include <sys/param.h>
  2006.   /* This is for hpux.  It is a real screw.  They should change hpux.  */
  2007. ***************
  2008. *** 41,49 ****
  2009. --- 41,57 ----
  2010.   #undef FFS  /* Some systems define this in param.h.  */
  2011.   #else
  2012.   #ifndef VMS
  2013. + #if (!(defined(atarist) || defined(atariminix)))
  2014.   #include <sys/time.h>
  2015.   #include <sys/resource.h>
  2016. + #endif /* !(atarist || atariminix) */
  2017. + #endif
  2018.   #endif
  2019. + #ifdef atariminix
  2020. + #include <sys/times.h>
  2021. + /* #include <minix/const.h>, avoid dragging this in */
  2022. + #define HZ 60    /* this is the only thing needed from minix/const.h */
  2023.   #endif
  2024.   
  2025.   #include "input.h"
  2026. ***************
  2027. *** 61,66 ****
  2028. --- 69,79 ----
  2029.   #include "bytecode.h"
  2030.   #include "bc-emit.h"
  2031.   
  2032. + #ifdef atarist
  2033. + long _stksize = -1L;    /* for all sizes of ST's */
  2034. +     /* -1 means malloc from own heap and keep all  of memory */
  2035. + #endif /* atarist */
  2036.   #ifdef VMS
  2037.   /* The extra parameters substantially improve the I/O performance.  */
  2038.   static FILE *
  2039. ***************
  2040. *** 792,798 ****
  2041.   int
  2042.   get_run_time ()
  2043.   {
  2044. ! #ifdef USG
  2045.     struct tms tms;
  2046.   #else
  2047.   #ifndef VMS
  2048. --- 805,814 ----
  2049.   int
  2050.   get_run_time ()
  2051.   {
  2052. ! #ifdef atarist
  2053. !   long now;
  2054. ! #else
  2055. ! #if (defined(USG) || defined(atariminix) || defined(CROSSHPUX))
  2056.     struct tms tms;
  2057.   #else
  2058.   #ifndef VMS
  2059. ***************
  2060. *** 807,817 ****
  2061.       } vms_times;
  2062.   #endif
  2063.   #endif
  2064.   
  2065.     if (quiet_flag)
  2066.       return 0;
  2067.   
  2068. ! #ifdef USG
  2069.     times (&tms);
  2070.     return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ);
  2071.   #else
  2072. --- 823,837 ----
  2073.       } vms_times;
  2074.   #endif
  2075.   #endif
  2076. + #endif
  2077.   
  2078.     if (quiet_flag)
  2079.       return 0;
  2080.   
  2081. ! #ifdef atarist
  2082. !   return(time(NULL) * 1000000);
  2083. ! #else
  2084. ! #if (defined(USG) || defined(atariminix) || defined(CROSSHPUX))
  2085.     times (&tms);
  2086.     return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ);
  2087.   #else
  2088. ***************
  2089. *** 824,829 ****
  2090. --- 844,850 ----
  2091.     return (vms_times.proc_user_time + vms_times.proc_system_time) * 10000;
  2092.   #endif
  2093.   #endif
  2094. + #endif
  2095.   }
  2096.   
  2097.   #define TIMEVAR(VAR, BODY)    \
  2098. ***************
  2099. *** 1461,1466 ****
  2100. --- 1482,1488 ----
  2101.     longjmp (float_handler, 1);
  2102.   }
  2103.   
  2104. + #ifndef atarist
  2105.   /* Handler for SIGPIPE.  */
  2106.   
  2107.   static void
  2108. ***************
  2109. *** 1470,1475 ****
  2110. --- 1492,1498 ----
  2111.   {
  2112.     fatal ("output pipe has been closed");
  2113.   }
  2114. + #endif
  2115.   
  2116.   /* Strip off a legitimate source ending from the input string NAME of
  2117.      length LEN. */
  2118. ***************
  2119. *** 1523,1528 ****
  2120. --- 1546,1552 ----
  2121.     putc ('\"', asm_file);
  2122.   }
  2123.   
  2124. + #ifdef SYSV
  2125.   /* Output a file name in the form wanted by System V.  */
  2126.   
  2127.   void
  2128. ***************
  2129. *** 1553,1558 ****
  2130. --- 1577,1583 ----
  2131.   #endif
  2132.   #endif
  2133.   }
  2134. + #endif
  2135.   
  2136.   /* Routine to build language identifier for object file. */
  2137.   static void
  2138. ***************
  2139. *** 1665,1671 ****
  2140. --- 1690,1700 ----
  2141.       {
  2142.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  2143.         strcpy (dumpname, dump_base_name);
  2144. + #ifndef atarist
  2145.         strcat (dumpname, ".jump");
  2146. + #else
  2147. +       strcat (dumpname, ".jmp");
  2148. + #endif
  2149.         jump_opt_dump_file = fopen (dumpname, "w");
  2150.         if (jump_opt_dump_file == 0)
  2151.       pfatal_with_name (dumpname);
  2152. ***************
  2153. *** 1687,1693 ****
  2154. --- 1716,1726 ----
  2155.       {
  2156.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  2157.         strcpy (dumpname, dump_base_name);
  2158. + #ifndef atarist
  2159.         strcat (dumpname, ".loop");
  2160. + #else
  2161. +       strcat (dumpname, ".lop");
  2162. + #endif
  2163.         loop_dump_file = fopen (dumpname, "w");
  2164.         if (loop_dump_file == 0)
  2165.       pfatal_with_name (dumpname);
  2166. ***************
  2167. *** 1698,1704 ****
  2168. --- 1731,1741 ----
  2169.       {
  2170.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  2171.         strcpy (dumpname, dump_base_name);
  2172. + #ifndef atarist
  2173.         strcat (dumpname, ".cse2");
  2174. + #else
  2175. +       strcat (dumpname, ".cs2");
  2176. + #endif
  2177.         cse2_dump_file = fopen (dumpname, "w");
  2178.         if (cse2_dump_file == 0)
  2179.       pfatal_with_name (dumpname);
  2180. ***************
  2181. *** 1709,1715 ****
  2182. --- 1746,1756 ----
  2183.       {
  2184.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  2185.         strcpy (dumpname, dump_base_name);
  2186. + #ifndef atarist
  2187.         strcat (dumpname, ".flow");
  2188. + #else
  2189. +       strcat (dumpname, ".flo");
  2190. + #endif
  2191.         flow_dump_file = fopen (dumpname, "w");
  2192.         if (flow_dump_file == 0)
  2193.       pfatal_with_name (dumpname);
  2194. ***************
  2195. *** 1720,1726 ****
  2196. --- 1761,1771 ----
  2197.       {
  2198.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 10);
  2199.         strcpy (dumpname, dump_base_name);
  2200. + #ifndef atarist
  2201.         strcat (dumpname, ".combine");
  2202. + #else
  2203. +       strcat (dumpname, ".cmb");
  2204. + #endif
  2205.         combine_dump_file = fopen (dumpname, "w");
  2206.         if (combine_dump_file == 0)
  2207.       pfatal_with_name (dumpname);
  2208. ***************
  2209. *** 1731,1737 ****
  2210. --- 1776,1786 ----
  2211.       {
  2212.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 7);
  2213.         strcpy (dumpname, dump_base_name);
  2214. + #ifndef atarist
  2215.         strcat (dumpname, ".sched");
  2216. + #else
  2217. +       strcat (dumpname, ".sch");
  2218. + #endif
  2219.         sched_dump_file = fopen (dumpname, "w");
  2220.         if (sched_dump_file == 0)
  2221.       pfatal_with_name (dumpname);
  2222. ***************
  2223. *** 1742,1748 ****
  2224. --- 1791,1801 ----
  2225.       {
  2226.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  2227.         strcpy (dumpname, dump_base_name);
  2228. + #ifndef atarist
  2229.         strcat (dumpname, ".lreg");
  2230. + #else
  2231. +       strcat (dumpname, ".lrg");
  2232. + #endif
  2233.         local_reg_dump_file = fopen (dumpname, "w");
  2234.         if (local_reg_dump_file == 0)
  2235.       pfatal_with_name (dumpname);
  2236. ***************
  2237. *** 1753,1759 ****
  2238. --- 1806,1816 ----
  2239.       {
  2240.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  2241.         strcpy (dumpname, dump_base_name);
  2242. + #ifndef atarist
  2243.         strcat (dumpname, ".greg");
  2244. + #else
  2245. +       strcat (dumpname, ".grg");
  2246. + #endif
  2247.         global_reg_dump_file = fopen (dumpname, "w");
  2248.         if (global_reg_dump_file == 0)
  2249.       pfatal_with_name (dumpname);
  2250. ***************
  2251. *** 1764,1770 ****
  2252. --- 1821,1831 ----
  2253.       {
  2254.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 8);
  2255.         strcpy (dumpname, dump_base_name);
  2256. + #ifndef atarist
  2257.         strcat (dumpname, ".sched2");
  2258. + #else
  2259. +       strcat (dumpname, ".sc2");
  2260. + #endif
  2261.         sched2_dump_file = fopen (dumpname, "w");
  2262.         if (sched2_dump_file == 0)
  2263.       pfatal_with_name (dumpname);
  2264. ***************
  2265. *** 1775,1781 ****
  2266. --- 1836,1846 ----
  2267.       {
  2268.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 7);
  2269.         strcpy (dumpname, dump_base_name);
  2270. + #ifndef atarist
  2271.         strcat (dumpname, ".jump2");
  2272. + #else
  2273. +       strcat (dumpname, ".jp2");
  2274. + #endif
  2275.         jump2_opt_dump_file = fopen (dumpname, "w");
  2276.         if (jump2_opt_dump_file == 0)
  2277.       pfatal_with_name (dumpname);
  2278. ***************
  2279. *** 1799,1805 ****
  2280. --- 1864,1874 ----
  2281.       {
  2282.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 10);
  2283.         strcpy (dumpname, dump_base_name);
  2284. + #ifndef atarist
  2285.         strcat (dumpname, ".stack");
  2286. + #else
  2287. +       strcat (dumpname, ".stk");
  2288. + #endif
  2289.         stack_reg_dump_file = fopen (dumpname, "w");
  2290.         if (stack_reg_dump_file == 0)
  2291.       pfatal_with_name (dumpname);
  2292. ***************
  2293. *** 2926,2937 ****
  2294. --- 2995,3016 ----
  2295.     int version_flag = 0;
  2296.     char *p;
  2297.   
  2298. + #ifdef atarist
  2299. + /* turn this on if you are going to set the TOS 1.4 dont clear heap flag */
  2300. + /*  _malloczero(1); */     /* zero mallocs by default */
  2301. + #endif  
  2302.     /* save in case md file wants to emit args as a comment.  */
  2303.     save_argc = argc;
  2304.     save_argv = argv;
  2305.   
  2306.     p = argv[0] + strlen (argv[0]);
  2307. + #ifndef atarist
  2308.     while (p != argv[0] && p[-1] != '/') --p;
  2309. + #else
  2310. +   while (p != argv[0] && ((p[-1] != '/') && (p[-1] != '\\') &&
  2311. +               (p[-1] != ':'))) --p;
  2312. + #endif
  2313.     progname = p;
  2314.   
  2315.   #ifdef RLIMIT_STACK
  2316. ***************
  2317. *** 2948,2956 ****
  2318. --- 3027,3037 ----
  2319.   
  2320.     signal (SIGFPE, float_signal);
  2321.   
  2322. + #ifndef atarist
  2323.   #ifdef SIGPIPE
  2324.     signal (SIGPIPE, pipe_closed);
  2325.   #endif
  2326. + #endif
  2327.   
  2328.     decl_printable_name = decl_name;
  2329.     lang_expand_expr = (struct rtx_def *(*)()) do_abort;
  2330. ***************
  2331. *** 3049,3054 ****
  2332. --- 3130,3147 ----
  2333.         else if (!strcmp (str, "dumpbase"))
  2334.           {
  2335.             dump_base_name = argv[++i];
  2336. + #ifdef atarist
  2337. +           /* dump_base_name will typically be 'foo.c' here.
  2338. +              Need to truncate at the '.', cause dots mean 
  2339. +              something here
  2340. +            */
  2341. +               {
  2342. +               char * n = dump_base_name;
  2343. +           for ( ; ((*n) && (*n != '.')) ; )
  2344. +                       n++;
  2345. +                   *n = '\0';
  2346. +           }
  2347. + #endif
  2348.           }
  2349.         else if (str[0] == 'd')
  2350.           {
  2351. ***************
  2352. *** 3480,3486 ****
  2353. --- 3573,3585 ----
  2354.        option flags in use.  */
  2355.     if (version_flag)
  2356.       {
  2357. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  2358. + #include "PatchLev.h"
  2359. +         fprintf (stderr, "%s version %s-atariST Patchlevel %s",
  2360. +          language_string, version_string, PatchLevel);
  2361. + #else
  2362.         fprintf (stderr, "%s version %s", language_string, version_string);
  2363. + #endif
  2364.   #ifdef TARGET_VERSION
  2365.         TARGET_VERSION;
  2366.   #endif
  2367. ***************
  2368. *** 3505,3510 ****
  2369. --- 3604,3611 ----
  2370.     if (output_bytecode)
  2371.       bc_write_file (stdout);
  2372.   
  2373. + #if (!(defined(atarist) || defined(atariminix)))
  2374. + #if (!(defined(CROSSHPUX)))
  2375.   #ifndef OS2
  2376.   #ifndef VMS
  2377.     if (flag_print_mem)
  2378. ***************
  2379. *** 3523,3528 ****
  2380. --- 3624,3631 ----
  2381.       }
  2382.   #endif /* not VMS */
  2383.   #endif /* not OS2 */
  2384. + #endif
  2385. + #endif
  2386.   
  2387.     if (errorcount)
  2388.       exit (FATAL_EXIT_CODE);
  2389. ***************
  2390. *** 3634,3636 ****
  2391. --- 3737,3758 ----
  2392.   
  2393.     fprintf (stderr, "\n");
  2394.   }
  2395. + #ifdef atarist
  2396. + #include <string.h>
  2397. + char *atari_filename_nondirectory(p)
  2398. + char *p;
  2399. + {
  2400. +     char *s;
  2401. +     
  2402. +     for(s = p + strlen(p); s != p; --s)
  2403. +     {
  2404. +     if((*s == '/') || (*s == '\\'))
  2405. +         break;
  2406. +     }
  2407. +     
  2408. +     return (s == p) ? p : s+1;
  2409. + }
  2410. + #endif
  2411. diff -rc gcc-2.5.0/varasm.c /net/acae127/home/bammi/usr2/gcc/varasm.c
  2412. *** gcc-2.5.0/varasm.c    Mon Nov 15 11:08:16 1993
  2413. --- /net/acae127/home/bammi/usr2/gcc/varasm.c    Mon Nov 15 14:50:30 1993
  2414. ***************
  2415. *** 2831,2836 ****
  2416. --- 2831,2839 ----
  2417.   {
  2418.     struct rtx_const val0, val1;
  2419.   
  2420. +   if (XEXP (x, 0) == pc_rtx || XEXP (x, 1) == pc_rtx)
  2421. +     return XEXP (x, 0) == XEXP (x, 1) ? const0_rtx : x;
  2422.     decode_rtx_const (GET_MODE (x), XEXP (x, 0), &val0);
  2423.     decode_rtx_const (GET_MODE (x), XEXP (x, 1), &val1);
  2424.   
  2425.